'''
Created on 16.12.2012

@author: felix
'''
from game.player.alpha_beta_player.alpha_beta_framework.movefilter.MoveFiltering import MoveFiltering
from game import GameLogic
from game.datastructure.PlayerColor import PlayerColor
class NoEmptySpaceMovesFilter(MoveFiltering):
    def acceptable(self, field, action):
        if action == (4,4):
            return True
        neighbours = GameLogic.getNeighbours(field, action)
        hasStonedNeighbour = False
        for neighbour in neighbours:
            x,y = neighbour
            if field.get(x,y) != PlayerColor.NONE:
                hasStonedNeighbour = True
                break
        return hasStonedNeighbour